#include "GameoverState.h"
#include "CharacterIdle.h"

GameoverState::GameoverState(GameContext& gc)
	:GameState(gc)
{
}

GameoverState::~GameoverState(void)
{
}

void GameoverState::Load()
{
	mFont.Load(20);
	mCursor.Load("clickbutton.png");

	mMenuButton.Load("quitgreenButton_on.png", "easybluebuttom_on.png");
	mMenuButton.SetPosition(SVector2(350.0f, 550.0f));
	mMenuButton.SetText("Main Menu", 255, 0, 0);

	mQuitButton.Load("quitgreenButton_on.png", "diffcultButton_on.png");
	mQuitButton.SetPosition(SVector2(350.0f, 650.0f));
	mQuitButton.SetText("Quit", 255, 0, 0);

	background2.Load("GameOver.jpg");
	gameoverSound.Load("Gameoversound.mp3");
	gameoverSound.Play(true);
}

void GameoverState::Unload()
{
	mFont.Unload();
	mCursor.Unload();
	mMenuButton.Unload();
	mQuitButton.Unload();
	background2.Unload();
	gameoverSound.Unload();
}

NextState GameoverState::Update(float deltaTime)
{
	mCursor.Update(deltaTime);
	mMenuButton.Update(deltaTime);
	mQuitButton.Update(deltaTime);

	NextState nextState = None;

	if(mMenuButton.IsPressed())
	{
		nextState = Frontend;
	}
	else if(mQuitButton.IsPressed())
	{
		nextState = Quit;
	}
	return nextState;
}

void GameoverState::Render()
{
	background2.Render();
	/*mFont.Print("Welcome to the chicken coupe", 200, 250);*/
	mMenuButton.Render();
	mQuitButton.Render();
	mCursor.Render();
}